﻿using System;
using System.Net.Http.Headers;
using IListNode;

namespace JZ_55_er_cha_shu_de_shen_du_lcof
{
    class Program
    {
        static void Main (string[] args)
        {
            TreeNode root = new TreeNode (3);
            root.left = new TreeNode (9);
            root.right = new TreeNode (20);
            root.right.left = new TreeNode (15);
            root.right.left.left = new TreeNode (3);

            Solution s = new Solution ();
            Console.WriteLine (s.MaxDepth (root));
        }
    }

    public class Solution
    {
        public int MaxDepth (TreeNode root)
        {
            if (root == null) return 0;

            return Math.Max (MaxDepth (root.left), MaxDepth (root.right)) + 1;
        }
    }
}
